<?php
	echo "<h2 id='contentTitle'>".$html->view->pageTitle."</h2>";
	echo $this->renderElement('message');

	echo $html->link('Cadastrar fopcoe', '/fopcoes/add/');
	echo "<br /><br />";

	if (isset($fopcoes) && is_array($fopcoes) && (!empty($fopcoes))) {
		echo "<table>";
		echo "<tr class='sort'>";
			echo "<th>Id</th>";
			echo "<th>Valor</th>";
			echo "<th>Fcampo</th>";
			echo "<th>Editar</th>";
			echo "<th>Excluir</th>";
		echo "</tr>";

		$i=0;
		foreach ($fopcoes as $fopcao) {
			if (($i++ % 2) == 1) $zebrado = " class='oddTr' ";
			else $zebrado = "";
			echo "<tr ".$zebrado.">";
			echo "<td>".$html->link($fopcao['Fopcao']['id'],'/fopcoes/view/'.$fopcao['Fopcao']['id'])."</td>";
			echo "<td>".$html->link( $fopcao['Fopcao']['valor'], '/fopcoes/view/'.$fopcao['Fopcao']['id'])."</td>";
			echo "<td>".$html->link($fopcao['Fcampo']['nome'],'/fcampos/view/'.$fopcao['Fcampo']['id'])."</td>";
			echo "<td>".html_entity_decode($html->link($html->image('fileedit.png',array('class'=>'opIcon')), '/fopcoes/edit/'.$fopcao['Fopcao']['id']))."</td>";
			echo "<td>".html_entity_decode($html->link($html->image('filedel.png',array('class'=>'opIcon')), '/fopcoes/delete/'.$fopcao['Fopcao']['id'], array(), 'Confirma a exclusão deste item?'))."</td>";
			echo "</tr>";
		}
		echo "<tr id='footerTable'><td colspan='100%'></td></tr>";
		echo "</table>";
	}
?>
